package com.weds.data_sync.config;

import com.weds.data_sync.constant.ScriptServiceConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;

/**
 * @Description webclient 配置
 * @Author lihw
 * @Date 2024/1/9 11:18
 */
@Slf4j
@Configuration
public class WebClientConfig {

    private static final String BASE_URL = ScriptServiceConstant.SCRIPT_REQUEST_HOST;

    @Bean
    public WebClient.Builder webClientBuilder() {
        return WebClient.builder();
    }

    @Bean
    public WebClient webClient(WebClient.Builder webClientBuilder) {
        return webClientBuilder.baseUrl(BASE_URL).build();
    }

}
